{\rtf1\ansi\ansicpg1252\uc1 \deff0\deflang1033\deflangfe1033{\fonttbl{\f0\froman\fcharset0\fprq2{\*\panose 02020603050405020304}Times New Roman;}{\f2\fmodern\fcharset0\fprq1{\*\panose 02070309020205020404}Courier New;}
{\f14\fnil\fcharset2\fprq2{\*\panose 05000000000000000000}Wingdings;}{\f17\fswiss\fcharset0\fprq2{\*\panose 020b0506020202030204}Arial Narrow;}{\f68\froman\fcharset238\fprq2 Times New Roman CE;}{\f69\froman\fcharset204\fprq2 Times New Roman Cyr;}
{\f71\froman\fcharset161\fprq2 Times New Roman Greek;}{\f72\froman\fcharset162\fprq2 Times New Roman Tur;}{\f73\froman\fcharset186\fprq2 Times New Roman Baltic;}{\f80\fmodern\fcharset238\fprq1 Courier New CE;}
{\f81\fmodern\fcharset204\fprq1 Courier New Cyr;}{\f83\fmodern\fcharset161\fprq1 Courier New Greek;}{\f84\fmodern\fcharset162\fprq1 Courier New Tur;}{\f85\fmodern\fcharset186\fprq1 Courier New Baltic;}{\f170\fswiss\fcharset238\fprq2 Arial Narrow CE;}
{\f171\fswiss\fcharset204\fprq2 Arial Narrow Cyr;}{\f173\fswiss\fcharset161\fprq2 Arial Narrow Greek;}{\f174\fswiss\fcharset162\fprq2 Arial Narrow Tur;}{\f175\fswiss\fcharset186\fprq2 Arial Narrow Baltic;}}{\colortbl;\red0\green0\blue0;
\red0\green0\blue255;\red0\green255\blue255;\red0\green255\blue0;\red255\green0\blue255;\red255\green0\blue0;\red255\green255\blue0;\red255\green255\blue255;\red0\green0\blue128;\red0\green128\blue128;\red0\green128\blue0;\red128\green0\blue128;
\red128\green0\blue0;\red128\green128\blue0;\red128\green128\blue128;\red192\green192\blue192;}{\stylesheet{\widctlpar\adjustright \fs22\cgrid \snext0 Normal;}{\s1\keepn\widctlpar\outlinelevel0\adjustright \b\fs22\cgrid \sbasedon0 \snext0 heading 1;}{
\s2\keepn\widctlpar\outlinelevel1\adjustright \b\cgrid \sbasedon0 \snext0 heading 2;}{\s3\keepn\widctlpar\outlinelevel2\adjustright \b\fs28\cgrid \sbasedon0 \snext0 heading 3;}{\*\cs10 \additive Default Paragraph Font;}{\s15\widctlpar
\tqc\tx4320\tqr\tx8640\adjustright \fs22\cgrid \sbasedon0 \snext15 header;}{\s16\widctlpar\tqc\tx4320\tqr\tx8640\adjustright \fs22\cgrid \sbasedon0 \snext16 footer;}{\*\cs17 \additive \sbasedon10 page number;}}{\info
{\title Note: the appending of \'93_level\'94 to all field names was not an arbitrary attempt to make things difficult}{\author George Spofford}{\operator George Spofford}{\creatim\yr1998\mo9\dy12\hr15\min16}{\revtim\yr1998\mo9\dy16\hr10\min35}
{\printim\yr1998\mo9\dy12\hr19\min26}{\version16}{\edmins134}{\nofpages6}{\nofwords1404}{\nofchars8005}{\*\company Dimensional Systems}{\nofcharsws0}{\vern89}}\widowctrl\ftnbj\aenddoc\hyphcaps0\formshade\viewkind4\viewscale100\pgbrdrhead\pgbrdrfoot \fet0
{\*\template \\\\NT_SERVER\\e$\\Templates\\DimSys Normal.dot}{\*\docvar {BadObjects}{ }}{\*\docvar {SelEnd}{ }}{\*\docvar {SelStart}{ }}\sectd \linex0\endnhere\sectdefaultcl {\footer \pard\plain \s16\qc\widctlpar\brdrt\brdrdb\brdrw10\brsp60 
\tqc\tx4320\tqr\tx8640\adjustright \fs22\cgrid {\f17 Dimensional Systems,  222 Third Street, Suite 3122,  Cambridge, MA 02142
\par }\pard \s16\qc\widctlpar\tqc\tx4320\tqr\tx8640\adjustright {\f17 (617) 492-3555  }{\f14\fs24\cgrid0 \'73}{\f17   fax (617) 492-3508  }{\f14\fs24\cgrid0 \'73}{\f17   http://www.dimsys.com
\par }\pard \s16\qc\sb120\widctlpar\tqc\tx4320\tqr\tx8640\adjustright {\field{\*\fldinst {\cs17  PAGE }}{\fldrslt {\cs17\lang1024 3}}}{\cs17  of }{\field{\*\fldinst {\cs17  NUMPAGES }}{\fldrslt {\cs17\lang1024 1}}}{\f17 
\par }}{\*\pnseclvl1\pnucrm\pnstart1\pnindent720\pnhang{\pntxta .}}{\*\pnseclvl2\pnucltr\pnstart1\pnindent720\pnhang{\pntxta .}}{\*\pnseclvl3\pndec\pnstart1\pnindent720\pnhang{\pntxta .}}{\*\pnseclvl4\pnlcltr\pnstart1\pnindent720\pnhang{\pntxta )}}
{\*\pnseclvl5\pndec\pnstart1\pnindent720\pnhang{\pntxtb (}{\pntxta )}}{\*\pnseclvl6\pnlcltr\pnstart1\pnindent720\pnhang{\pntxtb (}{\pntxta )}}{\*\pnseclvl7\pnlcrm\pnstart1\pnindent720\pnhang{\pntxtb (}{\pntxta )}}{\*\pnseclvl8
\pnlcltr\pnstart1\pnindent720\pnhang{\pntxtb (}{\pntxta )}}{\*\pnseclvl9\pnlcrm\pnstart1\pnindent720\pnhang{\pntxtb (}{\pntxta )}}\pard\plain \s3\keepn\widctlpar\outlinelevel2\adjustright \b\fs28\cgrid {\fs32 APB-1 R2 Validation Scripts
\par }\pard\plain \widctlpar\adjustright \fs22\cgrid {
\par This document describes the use of the SQL validation scripts and fragments distributed with the APB-1 file generator.
\par 
\par }\pard\plain \s2\keepn\widctlpar\outlinelevel1\adjustright \b\cgrid {Defining and loading tables (DDL and DML)
\par }\pard\plain \widctlpar\adjustright \fs22\cgrid {The file APB1Schm.sql contains SQL DDL that will create the tables and indexes used by the validation script templates. The DDL is intended to be generic and should import into most SQL RDBMSs without any 
difficulty. The dimension and fact tables defined (denoted in the DDL file) closely mirror the APB-1 files, and should be straightforward to load using the RDBMS loader. 
\par 
\par After loading the tables, run the script APB1Load1.sql to calculate the COST variable for the actual and budget scenarios.
\par 
\par Note that the appending of \ldblquote _level\rdblquote  to all dimension level field names, and \ldblquote _name\rdblquote  to all hierarchy tree field names, 
was not an arbitrary attempt to make things difficult. Rather, the existence of field names like \ldblquote Group\rdblquote , \ldblquote Code\rdblquote  and \ldblquote Level\rdblquote  may collide with reserved wor
ds in particular SQL implementations, and quoting the names may or may not be a reliable way of using these reserved words. Plus, quoting conventions are different for different RDBMSs.
\par 
\par }{\b\fs24 Query and Pre-calculation Templates
\par }{The necessary pre-calculation ste
ps and benchmark queries are provided as a set of SQL templates. By and large, the templates are ready to run except for some template parameters that need to have specific values filled in. All template parameters are prefixed with a dollar sign ($). The
 
way in which calculations are performed may be sub-optimal on a particular RDBMS if it allows more advanced calculation syntax. Additionally, for larger dimension sizes and more dense data sets, some of the pre-calculation operations might execute more qu
ickly if large GROUP BYs were broken up into loops over channel members.
\par 
\par }{\i How to use the templates in general:
\par }{
\par For each given member in the query, there will be a corresponding template parameter named $}{\i dim}{
MEMBER (i.e. $PRODMEMBER, $TIMEMEMBER, $CUSTMEMBER, $CHANMEMBER; for query 10, also $SCENMEMBER). For each given member in the query, determine the level of that member using the tree table (ProdTree, TimeTree, CustTree and ChanTree). Replace each $}{\i 
dim}{_GIVEN_LEVEL_FNAME with the appropriate given field name for the level table (ProdLevel, TimeLevel, CustLevel, ChanLevel), and each $}{\i dim}{_CHILD_LEVEL_FNAME with the child level\rquote s field name. Replace each $}{\i dim}{
MEMBER in the template with the name of the member as it appears in the query file.
\par 
\par For example, refer to the following template for query 1:
\par }\pard \keepn\widctlpar\adjustright {
\par }\pard \keepn\widctlpar\brdrt\brdrs\brdrw10\brsp20 \brdrl\brdrs\brdrw10\brsp80 \brdrb\brdrs\brdrw10\brsp20 \brdrr\brdrs\brdrw10\brsp80 \adjustright {\f2\fs18 /* Q1 SQL Template */
\par 
\par select
\par \tab prodlevel.$PROD_CHILD_LEVEL_FNAME,
\par \tab custlevel.$CUST_CHILD_LEVEL_FNAME,
\par \tab chanlevel.$CHAN_GIVEN_LEVEL_FNAME,
\par \tab timelevel.$TIME_CHILD_LEVEL_FNAME,
\par \tab sum (a.unitssold) AS Units, 
\par \tab sum (a.dollarsales) AS Dollars, 
\par \tab sum (a.dollarsales) / sum (a.unitssold) AS Price
\par from
\par \tab actvars a, prodlevel, timelevel, custlevel, chanlevel
\par where
\par \tab     a.channel_level = \lquote $CHANMEMBER\rquote 
\par \tab and a.product_level = prodlevel.code_level
\par \tab and a.time_level =  timelevel.Month_level
\par \tab and a.customer_level = custlevel.store_level
\par \tab and a.channel_level = chanlevel.base_level
\par \tab and prodlevel.$PROD_CHILD_LEVEL_FNAME in (
\par \tab   select member_name from prodtree where parent}{\f2\fs18 _name}{\f2\fs18  = '$PRODMEMBER'
\par \tab )
\par \tab and timelevel.$TIME_CHILD_LEVEL_FNAME in (
\par \tab   select member}{\f2\fs18 _name}{\f2\fs18  from timetree where parent}{\f2\fs18 _name}{\f2\fs18  = '$TIMEMEMBER'
\par \tab )
\par \tab and custlevel.$CUST_CHILD_LEVEL_FNAME in (
\par \tab   select member}{\f2\fs18 _name}{\f2\fs18  from custtree where parent}{\f2\fs18 _name}{\f2\fs18  = '$CUSTMEMBER'
\par \tab )\tab 
\par group by
\par \tab prodlevel.$PROD_CHILD_LEVEL_FNAME,
\par \tab chanlevel.$CHAN_GIVEN_LEVEL_FNAME,
\par \tab custlevel.$CUST_CHILD_LEVEL_FNAME,
\par \tab timelevel.$TIME_CHILD_LEVEL_FNAME
\par order by
\par \tab prodlevel.$PROD_CHILD_LEVEL_FNAME,
\par \tab custlevel.$CUST_CHILD_LEVEL_FNAME,
\par \tab timelevel.$TIME_CHILD_LEVEL_FNAME
\par }\pard \keepn\widctlpar\adjustright {
\par }\pard \widctlpar\adjustright {Assume that the given members are product P1, customer Cu1, channel Ch1, time 1995.
\par Referring to the product tree table PRODTREE, with a query like:
\par }\pard \li720\widctlpar\adjustright {\f2\fs20 select Level_name from ProdTree where member_name = \lquote P1\rquote 
\par }\pard \widctlpar\adjustright {the level name for P1 is found to be Family. To turn this level name into a field name, append \ldblquote _level\rdblquote  to it. Thus, $PROD_CHILD_LEVEL_FNAME will be }{\b Group_level}{
, as the child level for Family is Group. Similarly, Cu1 is found to be a Retailer in CUSTTREE, and $CUST_CHILD_LEVEL_FNAME will therefore be }{\b Store_level}{. Ch1 is found to be a Base, so its $CHAN_GIVEN_LEVEL_FNAME is }{\b Base_level}{
, and 1995 is found to be a Year, so its $TIME_CHILD_LEVEL_FNAME is }{\b Quarter_level}{. To execute the query, plug these strings into the template:
\par 
\par }\pard \keepn\widctlpar\adjustright {
\par }\pard \keepn\widctlpar\brdrt\brdrs\brdrw10\brsp20 \brdrl\brdrs\brdrw10\brsp80 \brdrb\brdrs\brdrw10\brsp20 \brdrr\brdrs\brdrw10\brsp80 \adjustright {\f2\fs18 /* Q1 SQL (filled in) */
\par 
\par select
\par \tab prodlevel.Group_level,
\par \tab custlevel.Store_level,
\par \tab chanlevel.Base_level,
\par \tab timelevel.Quarter_level,
\par \tab sum (a.unitssold) AS Units, 
\par \tab sum (a.dollarsales) AS Dollars, 
\par \tab sum (a.dollarsales) / sum (a.unitssold) AS Price
\par from
\par \tab actvars a, prodlevel, timelevel, custlevel, chanlevel
\par where
\par \tab     a.channel_level = \lquote Ch1\rquote 
\par \tab and a.product_level = prodlevel.code_level
\par \tab and a.time_level =  timelevel.Month_level
\par \tab and a.customer_level = custlevel.store_level
\par \tab and a.channel_level = chanlevel.base_level
\par \tab and prodlevel.Group_level in (
\par \tab   select member}{\f2\fs18 _name}{\f2\fs18  from prodtree where parent}{\f2\fs18 _name}{\f2\fs18  = 'P1'
\par \tab )
\par \tab and timelevel.Quarter_level in (
\par \tab   select member}{\f2\fs18 _name}{\f2\fs18  from timetree where parent}{\f2\fs18 _name}{\f2\fs18  = '1995'
\par \tab )
\par \tab and custlevel.Base_level in (
\par \tab   select member}{\f2\fs18 _name}{\f2\fs18  from custtree where parent}{\f2\fs18 _name}{\f2\fs18  = 'Cu1'
\par \tab )\tab 
\par group by
\par \tab prodlevel.Group_level,
\par \tab chanlevel.Base_level,
\par \tab custlevel.Store_level,
\par \tab timelevel.Quarter_level
\par order by
\par \tab prodlevel.Group_level,
\par \tab custlevel.Store_level,
\par \tab timelevel.Quarter_level
\par }\pard \keepn\widctlpar\adjustright {
\par }\pard \widctlpar\adjustright {
\par This same general form is repeated in the templates for queries 1, 2, 3, 4, 5, 6, 7 and 10. In addition, this general form is used for the queries that perform pre-calculation steps 
for queries 4, 7, 8, 9 and 10. (Queries 8 and 9 are static, relying solely on the pre-calculation steps).
\par 
\par Queries 1, 5 and 6 are the most straightforward; filling in the template parameters is all that is required to execute the query. Queries 2, 3, 4, 7,
 8 and 9 require multiple steps to execute. Queries 2 and 3 each execute in multiple steps, where each step uses template parameters.  Query 4 requires a temporary table to be filled in with a series of steps.  Query 7, 8 and 9 each require a set of tempo
r
ary tables to be filled in; for each of them, a single script with template parameters will perform all the work.  Query 10 is a special case, as it really breaks down into 25 separate sub-queries, and a set of query templates is provided for each sub-que
ry.
\par 
\par }\pard \keepn\widctlpar\adjustright {\i Notes on the queries:
\par }{
\par }\pard\plain \s1\keepn\widctlpar\outlinelevel0\adjustright \b\fs22\cgrid {Q1
\par }\pard\plain \widctlpar\adjustright \fs22\cgrid {Fill in the parameters and execute.
\par 
\par }\pard\plain \s1\keepn\widctlpar\outlinelevel0\adjustright \b\fs22\cgrid {Q2
\par }\pard\plain \widctlpar\adjustright \fs22\cgrid {Executes in three separate parts; determine the actual values for the template parameters, and substitute into each part. Each part returns a portion of the overall result.
\par 
\par }\pard\plain \s1\keepn\widctlpar\outlinelevel0\adjustright \b\fs22\cgrid {Q3
\par }\pard\plain \widctlpar\adjustright \fs22\cgrid {Executes in three separate parts; determine the actual values for the template parameters, and substitute into each part. Each part returns a portion of the overall result.
\par 
\par }\pard\plain \s1\keepn\widctlpar\outlinelevel0\adjustright \b\fs22\cgrid {Q4
\par }\pard\plain \widctlpar\adjustright \fs22\cgrid {Requires population of the table \ldblquote tmprolling\rdblquote  using the script q04_prep.sql. While the s
cript uses the same template parameters as the others, the fact that the benchmark will query for the children of a quarter means that intermediate values for a range of result months must be calculated. The preparation script q04_prep describes all steps
 required. 
\par 
\par }\pard\plain \s1\keepn\widctlpar\outlinelevel0\adjustright \b\fs22\cgrid {Q5
\par }\pard\plain \widctlpar\adjustright \fs22\cgrid {Fill in the parameters and execute.
\par 
\par }\pard\plain \s1\keepn\widctlpar\outlinelevel0\adjustright \b\fs22\cgrid {Q6
\par }\pard\plain \widctlpar\adjustright \fs22\cgrid {Fill in the parameters and execute.
\par 
\par }\pard\plain \s1\keepn\widctlpar\outlinelevel0\adjustright \b\fs22\cgrid {Q7
\par }\pard\plain \widctlpar\adjustright \fs22\cgrid {Requires population of a series of intermediate tables.  The script fcst_prep.sql performs all of the population steps, including aggregations and allocations.  
\par 
\par In addition to the template parameters described above, this preparation script uses another template parameter, $FCSTRETAILER, to limit the space in which calculations are performed.  Prior to executing any query 7, query 9,or forecast-related query 10,
 the set of retailers for any customer members referenced in the queries to be validated should be determined and plugged into $FCSTRETAILER.
\par 
\par }\pard\plain \s1\keepn\widctlpar\outlinelevel0\adjustright \b\fs22\cgrid {Q8
\par }\pard\plain \widctlpar\adjustright \fs22\cgrid {Requires population of three intermediate tables.  The preparation script q08_prep.sql performs all population
 steps, using template parameters as generally described.  The preparation script should be run prior to each execution of a query 8.
\par 
\par }\pard\plain \s1\keepn\widctlpar\outlinelevel0\adjustright \b\fs22\cgrid {Q9
\par }\pard\plain \widctlpar\adjustright \fs22\cgrid {Requires population of three intermediate tables.  The preparation script q09_prep.sql performs all population steps, 
using template parameters as generally described. The preparation script should be run prior to each execution of a query 9.
\par 
\par }\pard\plain \s1\keepn\widctlpar\outlinelevel0\adjustright \b\fs22\cgrid {Q10
\par }\pard\plain \keepn\widctlpar\adjustright \fs22\cgrid {Requires selecting a particular sub-query template based upon the scenario and measure.  If the scenario is "forecast ", then 
the retailer associated with the customer member should be extracted for the pre-calculation required; see the description for Q7.  The "smoothed sales" measure will require running the related preparation script (depending upon the scenario).
\par 
\par 
\par }\trowd \trgaph108\trleft-108\trbrdrt\brdrs\brdrw10 \trbrdrl\brdrs\brdrw10 \trbrdrb\brdrs\brdrw10 \trbrdrr\brdrs\brdrw10 \trbrdrh\brdrs\brdrw10 \trbrdrv\brdrs\brdrw10 \clvertalt\clbrdrt\brdrs\brdrw10 \clbrdrl\brdrs\brdrw10 \clbrdrb\brdrs\brdrw10 \clbrdrr
\brdrs\brdrw10 \cltxlrtb \cellx1440\clvertalt\clbrdrt\brdrs\brdrw10 \clbrdrl\brdrs\brdrw10 \clbrdrb\brdrs\brdrw10 \clbrdrr\brdrs\brdrw10 \cltxlrtb \cellx3330\clvertalt\clbrdrt\brdrs\brdrw10 \clbrdrl\brdrs\brdrw10 \clbrdrb\brdrs\brdrw10 \clbrdrr
\brdrs\brdrw10 \cltxlrtb \cellx4770\clvertalt\clbrdrt\brdrs\brdrw10 \clbrdrl\brdrs\brdrw10 \clbrdrb\brdrs\brdrw10 \clbrdrr\brdrs\brdrw10 \cltxlrtb \cellx6300\clvertalt\clbrdrt\brdrs\brdrw10 \clbrdrl\brdrs\brdrw10 \clbrdrb\brdrs\brdrw10 \clbrdrr
\brdrs\brdrw10 \cltxlrtb \cellx7830\clvertalt\clbrdrt\brdrs\brdrw10 \clbrdrl\brdrs\brdrw10 \clbrdrb\brdrs\brdrw10 \clbrdrr\brdrs\brdrw10 \cltxlrtb \cellx9540\pard \keepn\widctlpar\intbl\adjustright {\b\fs20 Measure\cell Value to substitute for $FUNC\cell 
Actual  template\cell Budget template, $TABLE value\cell Forecast 
\par template,
\par $TABLE value\cell Notes\cell }\pard \widctlpar\intbl\adjustright {\b\fs20 \row }\trowd \trgaph108\trleft-108\trbrdrt\brdrs\brdrw10 \trbrdrl\brdrs\brdrw10 \trbrdrb\brdrs\brdrw10 \trbrdrr\brdrs\brdrw10 \trbrdrh\brdrs\brdrw10 \trbrdrv\brdrs\brdrw10 
\clvertalt\clbrdrt\brdrs\brdrw10 \clbrdrl\brdrs\brdrw10 \clbrdrb\brdrs\brdrw10 \clbrdrr\brdrs\brdrw10 \cltxlrtb \cellx1440\clvertalt\clbrdrt\brdrs\brdrw10 \clbrdrl\brdrs\brdrw10 \clbrdrb\brdrs\brdrw10 \clbrdrr\brdrs\brdrw10 \cltxlrtb \cellx3330\clvertalt
\clbrdrt\brdrs\brdrw10 \clbrdrl\brdrs\brdrw10 \clbrdrb\brdrs\brdrw10 \clbrdrr\brdrs\brdrw10 \cltxlrtb \cellx4770\clvertalt\clbrdrt\brdrs\brdrw10 \clbrdrl\brdrs\brdrw10 \clbrdrb\brdrs\brdrw10 \clbrdrr\brdrs\brdrw10 \cltxlrtb \cellx6300\clvertalt\clbrdrt
\brdrs\brdrw10 \clbrdrl\brdrs\brdrw10 \clbrdrb\brdrs\brdrw10 \clbrdrr\brdrs\brdrw10 \cltxlrtb \cellx7830\clvertalt\clbrdrt\brdrs\brdrw10 \clbrdrl\brdrs\brdrw10 \clbrdrb\brdrs\brdrw10 \clbrdrr\brdrs\brdrw10 \cltxlrtb \cellx9540\pard 
\keepn\widctlpar\intbl\adjustright {\fs20 UnitsSold\cell sum(UnitsSold)\cell q10_a.sql,
\par actvars\cell q10_b.sql, planvars\cell q10_b.sql, FcstMonthStoreProduct\cell \cell }\pard \widctlpar\intbl\adjustright {\fs20 \row }\pard \keepn\widctlpar\intbl\adjustright {\fs20 DollarSales\cell sum(DollarSales)\cell q10_a.sql,
\par actvars\cell q10_b.sql, planvars\cell q10_b.sql, FcstMonthStoreProduct\cell \cell }\pard \widctlpar\intbl\adjustright {\fs20 \row }\pard \keepn\widctlpar\intbl\adjustright {\fs20 Cost\cell sum(DollarCost)\cell q10_a.sql,
\par actvars\cell q10_b.sql, planvars\cell q10_b.sql, FcstMonthStoreProduct\cell \cell }\pard \widctlpar\intbl\adjustright {\fs20 \row }\pard \keepn\widctlpar\intbl\adjustright {\fs20 Margin\cell sum(DollarSales) - sum(DollarCost)\cell q10_a.sql,
\par actvars\cell q10_b.sql, planvars\cell q10_b.sql, FcstMonthStoreProduct\cell \cell }\pard \widctlpar\intbl\adjustright {\fs20 \row }\pard \keepn\widctlpar\intbl\adjustright {\fs20 AverageSellingPrice\cell sum(DollarSales) / sum(UnitsSold)\cell q10_a.sql,

\par actvars\cell q10_b.sql, planvars\cell q10_b.sql, FcstMonthStoreProduct\cell \cell }\pard \widctlpar\intbl\adjustright {\fs20 \row }\pard \keepn\widctlpar\intbl\adjustright {\fs20 MarginPercent\cell (sum(DollarSales) - sum(DollarCost)) / sum(DollarSales)
\cell q10_a.sql,
\par actvars\cell q10_b.sql, planvars\cell q10_b.sql, FcstMonthStoreProduct\cell \cell }\pard \widctlpar\intbl\adjustright {\fs20 \row }\pard \keepn\widctlpar\intbl\adjustright {\fs20 SmoothedSales
\par \cell sum(DollarSales)\cell q10_a.sql,
\par tmprolling\cell q10_a.sql,
\par tmprolling\cell q10_a.sql,
\par tmprolling\cell Run Q04_prep or  Q10_Smoothprep, as appropriate; Q10_Smoothprep uses $TABLE of planvars or FcstMonthStoreProduct\cell }\pard \widctlpar\intbl\adjustright {\fs20 \row }\pard \keepn\widctlpar\intbl\adjustright {\fs20 Inventory\cell sum( }{
\i\fs20 Column}{\fs20  )\cell \cell \cell \cell Template Q10inv_template.sql; select column and table for $TABLE based on time\cell }\pard \widctlpar\intbl\adjustright {\fs20 \row }\pard \keepn\widctlpar\intbl\adjustright {\fs20 StandardShipCost\cell 
}\pard\plain \s15\keepn\widctlpar\intbl\adjustright \fs22\cgrid {\fs20 \cell }\pard\plain \keepn\widctlpar\intbl\adjustright \fs22\cgrid {\fs20 StdShipCost\cell StdShipCost\cell \cell 
Template Q10_stdship.sql Function in template. Use scenario as argument to template\cell }\pard \widctlpar\intbl\adjustright {\fs20 \row }\trowd \trgaph108\trleft-108\trbrdrt\brdrs\brdrw10 \trbrdrl\brdrs\brdrw10 \trbrdrb\brdrs\brdrw10 \trbrdrr
\brdrs\brdrw10 \trbrdrh\brdrs\brdrw10 \trbrdrv\brdrs\brdrw10 \clvertalt\clbrdrt\brdrs\brdrw10 \clbrdrl\brdrs\brdrw10 \clbrdrb\brdrs\brdrw10 \clbrdrr\brdrs\brdrw10 \cltxlrtb \cellx1440\clvertalt\clbrdrt\brdrs\brdrw10 \clbrdrl\brdrs\brdrw10 \clbrdrb
\brdrs\brdrw10 \clbrdrr\brdrs\brdrw10 \cltxlrtb \cellx3330\clvertalt\clbrdrt\brdrs\brdrw10 \clbrdrl\brdrs\brdrw10 \clbrdrb\brdrs\brdrw10 \clbrdrr\brdrs\brdrw10 \cltxlrtb \cellx4770\clvertalt\clbrdrt\brdrs\brdrw10 \clbrdrl\brdrs\brdrw10 \clbrdrb
\brdrs\brdrw10 \clbrdrr\brdrs\brdrw10 \cltxlrtb \cellx6300\clvertalt\clbrdrt\brdrs\brdrw10 \clbrdrl\brdrs\brdrw10 \clbrdrb\brdrs\brdrw10 \clbrdrr\brdrs\brdrw10 \cltxlrtb \cellx7830\clvertalt\clbrdrt\brdrs\brdrw10 \clbrdrl\brdrs\brdrw10 \clbrdrb
\brdrs\brdrw10 \clbrdrr\brdrs\brdrw10 \cltxlrtb \cellx9540\pard \keepn\widctlpar\intbl\adjustright {\fs20 StandardProductCost\cell }\pard\plain \s15\keepn\widctlpar\intbl\adjustright \fs22\cgrid {\fs20 \cell }\pard\plain 
\keepn\widctlpar\intbl\adjustright \fs22\cgrid {\fs20 StdProdCost\cell StdProdCost\cell \cell Template Q10_stdprod.sql Function in template. \cell }\pard \widctlpar\intbl\adjustright {\fs20 \row }\pard \widctlpar\adjustright {
\par 
\par }}